<me:UIWFN x:Class="WPFExcelReport.TWFLOG"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"   
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"    
           xmlns:sys="clr-namespace:System;assembly=mscorlib"
            xmlns:WD="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTDEF"  
            xmlns:BOOK="clr-namespace:WPFExcelReport;assembly=TICC_WFSUBSCRIBER"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     Background="White"   
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWFN.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/> 
        <ucd:Divideby1000  x:Key="d1000"/>  
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/> 
    </me:UIWFN.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <StackPanel >
                <WrapPanel>
                    <TextBlock VerticalAlignment="Center" Margin="5" Text="{Binding Source={Localization:Translate Word=查看:}}"></TextBlock>
                    <SD:K14LG KEY="{Binding ORDERNUM,ElementName=TV}"/>
                    <Button Click="BtnClear_Click" ToolTip="清除所有日志"  Content="{Binding Source={Localization:Translate Word=清除}}"></Button>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="1*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=时间}}"></TextBlock>
                        <TextBox Grid.Column="1"  Text="{Binding Path=WFWHEN,Source={StaticResource vwMaster}}"></TextBox>
                    </Grid>
                </WrapPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=触发地}}" TextWrapping="Wrap"></TextBlock>
                    <TextBox Grid.Column="1" Text="{Binding Path=WFSOURCE,Source={StaticResource vwMaster}}" Height="200"   TextWrapping="Wrap"  Width="Auto" ></TextBox>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=明细}}"></TextBlock>
                    <TextBox Grid.Column="1"  Text="{Binding Path=WHAT,Source={StaticResource vwMaster}}"  TextWrapping="Wrap"  Width="Auto"></TextBox>
                </Grid>
            </StackPanel>
        </StackPanel>
            <DataGrid Grid.Row="1" 
                  Grid.Column="0" Grid.ColumnSpan="2"
                AutoGenerateColumns="False" 
                  EnableRowVirtualization="False" 
                  Name="dlgMaster"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" 
                      EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns> 
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=类型}}" Binding="{Binding ORDTYPE, Mode=OneWay}" Width="Auto" /> 
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=类型}}" Binding="{Binding HOW, Mode=OneWay}" Width="Auto" /> 
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=时间}}" Binding="{Binding WFWHEN, Mode=OneWay}" Width="Auto" />
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=位置}}" Binding="{Binding WHAT, Mode=OneWay}" Width="Auto" />
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=明细}}" Binding="{Binding WFSOURCE, Mode=OneWay}" Width="Auto" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</me:UIWFN>
